<template>
	<div>
		<Layout>
			<header class="masthead" style="background-image: url('/img/home-bg.jpg')">
				<div class="container position-relative px-4 px-lg-5">
					<div class="row gx-4 gx-lg-5 justify-content-center">
						<div class="col-md-10 col-lg-8 col-xl-7">
							<div class="site-heading">
								<h1>#{{$page.tag.title}}</h1>
							</div>
						</div>
					</div>
				</div>
			</header>
			<!-- Main Content-->
			<div class="container px-4 px-lg-5">
				<div class="row gx-4 gx-lg-5 justify-content-center">
					<div class="col-md-10 col-lg-8 col-xl-7">
						<!-- Post preview-->
						<div class="post-preview" v-for="posts in $page.tag.posts" :key="posts.id">
							<g-link :to="'/posts/' + posts.id">
								<h2 class="post-title">{{posts.title}}</h2>
								<!-- <h3 class="post-subtitle">Problems look mighty small from 150 miles up</h3> -->
							</g-link>
							<!-- Divider-->
							<hr class="my-4" />
						</div>
		
						<!-- Pager-->
						<!-- <div class="d-flex justify-content-end mb-4"><a class="btn btn-primary text-uppercase"
								href="#!">Older Posts →</a></div> -->
						<!-- <Pager :info="$page.posts.pageInfo" /> -->
					</div>
				</div>
			</div>
		</Layout>
	</div>
</template>

<page-query>
	query($id:ID!) {
	  tag:strapiTags (id:$id) {
	    id
	    title
	    posts { 
	      id
	      title
	    }
	  }
	}
</page-query>
<script>
	export default {
		name:'tag'
	}
</script>

<style>
</style>
